package com.central.scheduler.api.service;

import com.central.common.model.PageResult;
import com.central.common.model.Result;
import com.central.common.model.SysUser;
import com.central.common.service.ISuperService;
import com.central.scheduler.api.entity.treeview.TreeViewEntity;
import com.central.scheduler.common.utils.SnowFlakeUtils;
import com.central.scheduler.dao.model.ProcessDefinition;
import com.central.scheduler.dao.model.ProcessDefinitionLog;

import java.util.List;
import java.util.Map;

/**
 * @author Tindy
 * @date 2022/1/6
 * @describe
 */
public interface IProcessDefinitionService extends ISuperService<ProcessDefinition> {
    Result saveOrUpdateProcess(SysUser user, ProcessDefinition processDefinition, Boolean isFromProcessDefine) throws SnowFlakeUtils.SnowFlakeException;

    Result setOwners(SysUser user, List<String> owners, Long processId);

    PageResult<ProcessDefinition> findProcesses(Map<String, Object> params);

    List<Map<String, Object>> findProcessLogs(Long proId, Long code);

    Result switchVersion(SysUser user, Long logId);

    Result delVersion(SysUser user, Long logId);

    Result delProcess(SysUser user, Long processId);

    Result release(SysUser user, Long processId);

    ProcessDefinitionLog findProcessLogDtl(Long proId, Long code, Integer version);

    Result copyProcess(SysUser user, Long processId) throws SnowFlakeUtils.SnowFlakeException;

    TreeViewEntity viewTree(long code, Integer limit);
}
